﻿using Abp.Domain.Entities.Auditing;
using KDS.Mes.Mes.Factorys;
using KDS.Mes.Mes.LineAlcCodes;
using KDS.Mes.Mes.ProductModes;
using KDS.Mes.Mes.Workshops;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KDS.Mes.Mes.Lines
{
    /// <summary>
    /// 线体信息
    /// </summary>
    [Table("T_BasicLine")]
    public class Line : FullAuditedEntity
    {
      
        [ForeignKey("WorkshopId")]
        public virtual Workshop Workshop { get; set; }
        public virtual int WorkshopId { get; set; }

        [ForeignKey("ProductModeId")]
        public virtual ProductMode ProductMode { get; set; }
        public virtual int ProductModeId { get; set; }

        /// <summary>
        /// AlcCodes of this line.
        /// </summary>
        [ForeignKey("LineId")]
        public virtual ICollection<LineAlcCode> AlcCodes { get; set; }

        /// <summary>
        /// 线体名称
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string LineName { get; set; }

        /// <summary>
        /// 线体代码
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string LineCode { get; set; }

        public Line(int workshopId,int productModeId, string lineName, string lineCode)
        {
            WorkshopId = workshopId;
            ProductModeId= productModeId;
            LineName = lineName;
            LineCode = lineCode;

        }

        public Line()
        {

        }
    }
}
